using System;
using System.Runtime.Serialization;
using mock_ehr_lib.Model.Summary;

namespace mock_ehr_lib.Model.Quality
{
    [DataContract]
    public class Measure
    {
        [DataMember]
        public string Category { get; set; }
        [DataMember]
        public string NqfNo { get; set; }
        [DataMember]
        public string Description { get; set; }
        [DataMember]
        public string EvidenceSummary { get; set; }
        [DataMember]
        public string Question { get; set; }
        [DataMember]
        public string[] ExclusionQuestions { get; set; }
        [DataMember]
        public string InfoUrl { get; set; }

        public Func<PatientSummary, MeasureEvaluateResult> ResultEvaluator { get; set; }

        public Func<PatientSummary, bool> EligibilityEvaluator { get; set; }

        public MeasureEvaluateResult Evaluate(PatientSummary patientSummary)
        {
            return ResultEvaluator(patientSummary);
        }

        public bool IsEligible(PatientSummary patientSummary)
        {
            return EligibilityEvaluator(patientSummary);
        }
    }
}